import Mock from "mockjs";
import qs from "querystring";
Mock.mock(/^\/api\/message\/?(\?.+)?$/, "get", function (options) {
    const query = qs.parse(options.url);
    return Mock.mock({
        code: 0,
        msg: "",
        data: {
            total: 52,
            [`rows|${query.limit || 10}`]: [
                {
                    id: "@guid",
                    nickname: "@cname",
                    content: "@cparagraph(1,10)",
                    createDate: Date.now(),
                    "avatar|1": ["https://img2.baidu.com/it/u=655008548,376311635&fm=253&fmt=auto&app=120&f=JPEG?w=1333&h=800",
                        "https://img1.baidu.com/it/u=2839777526,1572161824&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500",
                        "https://img0.baidu.com/it/u=1794692643,1724173692&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800",
                        "https://img1.baidu.com/it/u=2670168549,446929257&fm=253&fmt=auto?w=1280&h=800",
                        "https://img1.baidu.com/it/u=1381594550,1150720827&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
                        "https://img2.baidu.com/it/u=599881972,387148343&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
                        "https://img1.baidu.com/it/u=3102923133,257813756&fm=253&app=120&f=JPEG?w=1280&h=800",
                        "https://img1.baidu.com/it/u=2584801100,4240679710&fm=253&app=138&f=JPEG?w=752&h=500",
                        "https://img1.baidu.com/it/u=3271771907,4210668026&fm=253&app=120&f=JPEG?w=1200&h=800",
                        "https://img0.baidu.com/it/u=3039582039,445374145&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
                        "https://img2.baidu.com/it/u=1165462682,1327464292&fm=253&app=120&f=JPEG?w=800&h=875",
                        "https://img1.baidu.com/it/u=3193037451,478243253&fm=253&app=120&f=JPEG?w=1280&h=800",
                        "https://img2.baidu.com/it/u=1641881331,2336844791&fm=253&app=120&f=JPEG?w=474&h=386",
                        "https://img0.baidu.com/it/u=3848315587,2114871374&fm=253&fmt=auto&app=120&f=JPEG?w=1200&h=750",
                        "https://img0.baidu.com/it/u=40690703,1174112333&fm=253&fmt=auto&app=120&f=JPEG?w=1250&h=800",
                        "https://img1.baidu.com/it/u=3751121768,1705342826&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
                        "https://gips1.baidu.com/it/u=1388439796,3981287053&fm=3028&app=3028&f=PNG&fmt=auto&q=75&size=f240_240",
                        "https://img1.baidu.com/it/u=3401577227,2291516516&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
                        "https://img0.baidu.com/it/u=3955637453,3373788253&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
                        "https://img1.baidu.com/it/u=2655157916,219638054&fm=253&app=120&f=JPEG?w=949&h=632",
                        "https://img1.baidu.com/it/u=796630537,3044309245&fm=253&app=120&f=JPEG?w=760&h=475",
                        "https://img2.baidu.com/it/u=447094130,947377532&fm=253&fmt=auto&app=120&f=JPEG?w=1139&h=712",
                        "https://img2.baidu.com/it/u=3167300348,2325052791&fm=253&app=138&f=JPEG?w=800&h=500",
                        "https://img1.baidu.com/it/u=2090984284,3307794563&fm=253&app=120&f=JPEG?w=800&h=1016",
                        "https://img2.baidu.com/it/u=511818612,451273543&fm=253&app=120&f=JPEG?w=588&h=856",
                        "https://img0.baidu.com/it/u=2389188151,1665302851&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
                        "https://img2.baidu.com/it/u=3019977816,3312577294&fm=253&app=120&f=JPEG?w=1351&h=760",
                        "https://img2.baidu.com/it/u=4202483503,687210041&fm=253&app=138&f=JPEG?w=456&h=674",
                        "https://img0.baidu.com/it/u=4143355100,1247818860&fm=253&app=120&f=JPEG?w=1280&h=800",
                        "https://img0.baidu.com/it/u=1068186656,221599679&fm=253&fmt=auto?w=1343&h=800",
                        "https://img0.baidu.com/it/u=1355629061,3160565025&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
                        "https://img0.baidu.com/it/u=3174344655,2977258260&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800",
                        "https://img1.baidu.com/it/u=4003652646,949569564&fm=253&app=120&f=JPEG?w=1422&h=800",
                        "https://img1.baidu.com/it/u=1090275773,214927270&fm=253&app=120&f=JPEG?w=1422&h=800",
                        "https://img0.baidu.com/it/u=3388018184,3189041475&fm=253&app=138&f=JPEG?w=889&h=500",
                        "https://img1.baidu.com/it/u=3131419225,71274629&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500",
                        "https://img1.baidu.com/it/u=4276406911,4083821470&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
                        "https://img1.baidu.com/it/u=3229608423,144554567&fm=253&app=120&f=JPEG?w=1351&h=760",
                        "https://img0.baidu.com/it/u=3583903682,1590615948&fm=253&app=120&f=JPEG?w=911&h=723",
                        "https://img0.baidu.com/it/u=3613907717,1910344794&fm=253&app=120&f=JPEG?w=627&h=909",
                        "https://img2.baidu.com/it/u=1158204142,1371130107&fm=253&fmt=auto&app=138&f=JPEG?w=803&h=500",
                        "https://img2.baidu.com/it/u=3749862948,713793301&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
                        "https://img1.baidu.com/it/u=1803792478,3109323428&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
                        "https://img1.baidu.com/it/u=3585971855,1527172746&fm=253&fmt=auto&app=138&f=JPEG?w=690&h=437",
                        "https://img1.baidu.com/it/u=2667302586,4126117773&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
                        "https://img1.baidu.com/it/u=433185194,1699979858&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
                        "https://img2.baidu.com/it/u=263512888,374806003&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"]
                },
            ],
        },
    });
});

Mock.mock("/api/message", "post", {
    code: 0,
    msg: "",
    data: {
        id: "@guid",
        nickname: "@cname",
        content: "@cparagraph(1,10)",
        createDate: Date.now(),
        "avatar|1": [
            "https://img2.baidu.com/it/u=655008548,376311635&fm=253&fmt=auto&app=120&f=JPEG?w=1333&h=800",
            "https://img1.baidu.com/it/u=2839777526,1572161824&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500",
            "https://img0.baidu.com/it/u=1794692643,1724173692&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800",
            "https://img1.baidu.com/it/u=2670168549,446929257&fm=253&fmt=auto?w=1280&h=800",
            "https://img1.baidu.com/it/u=1381594550,1150720827&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
            "https://img2.baidu.com/it/u=599881972,387148343&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
            "https://img1.baidu.com/it/u=3102923133,257813756&fm=253&app=120&f=JPEG?w=1280&h=800",
            "https://img1.baidu.com/it/u=2584801100,4240679710&fm=253&app=138&f=JPEG?w=752&h=500",
            "https://img1.baidu.com/it/u=3271771907,4210668026&fm=253&app=120&f=JPEG?w=1200&h=800",
            "https://img0.baidu.com/it/u=3039582039,445374145&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
            "https://img2.baidu.com/it/u=1165462682,1327464292&fm=253&app=120&f=JPEG?w=800&h=875",
            "https://img1.baidu.com/it/u=3193037451,478243253&fm=253&app=120&f=JPEG?w=1280&h=800",
            "https://img2.baidu.com/it/u=1641881331,2336844791&fm=253&app=120&f=JPEG?w=474&h=386",
            "https://img0.baidu.com/it/u=3848315587,2114871374&fm=253&fmt=auto&app=120&f=JPEG?w=1200&h=750",
            "https://img0.baidu.com/it/u=40690703,1174112333&fm=253&fmt=auto&app=120&f=JPEG?w=1250&h=800",
            "https://img1.baidu.com/it/u=3751121768,1705342826&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
            "https://gips1.baidu.com/it/u=1388439796,3981287053&fm=3028&app=3028&f=PNG&fmt=auto&q=75&size=f240_240",
            "https://img1.baidu.com/it/u=3401577227,2291516516&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
            "https://img0.baidu.com/it/u=3955637453,3373788253&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
            "https://img1.baidu.com/it/u=2655157916,219638054&fm=253&app=120&f=JPEG?w=949&h=632",
            "https://img1.baidu.com/it/u=796630537,3044309245&fm=253&app=120&f=JPEG?w=760&h=475",
            "https://img2.baidu.com/it/u=447094130,947377532&fm=253&fmt=auto&app=120&f=JPEG?w=1139&h=712",
            "https://img2.baidu.com/it/u=3167300348,2325052791&fm=253&app=138&f=JPEG?w=800&h=500",
            "https://img1.baidu.com/it/u=2090984284,3307794563&fm=253&app=120&f=JPEG?w=800&h=1016",
            "https://img2.baidu.com/it/u=511818612,451273543&fm=253&app=120&f=JPEG?w=588&h=856",
            "https://img0.baidu.com/it/u=2389188151,1665302851&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
            "https://img2.baidu.com/it/u=3019977816,3312577294&fm=253&app=120&f=JPEG?w=1351&h=760",
            "https://img2.baidu.com/it/u=4202483503,687210041&fm=253&app=138&f=JPEG?w=456&h=674",
            "https://img0.baidu.com/it/u=4143355100,1247818860&fm=253&app=120&f=JPEG?w=1280&h=800",
            "https://img0.baidu.com/it/u=1068186656,221599679&fm=253&fmt=auto?w=1343&h=800",
            "https://img0.baidu.com/it/u=1355629061,3160565025&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
            "https://img0.baidu.com/it/u=3174344655,2977258260&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800",
            "https://img1.baidu.com/it/u=4003652646,949569564&fm=253&app=120&f=JPEG?w=1422&h=800",
            "https://img1.baidu.com/it/u=1090275773,214927270&fm=253&app=120&f=JPEG?w=1422&h=800",
            "https://img0.baidu.com/it/u=3388018184,3189041475&fm=253&app=138&f=JPEG?w=889&h=500",
            "https://img1.baidu.com/it/u=3131419225,71274629&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500",
            "https://img1.baidu.com/it/u=4276406911,4083821470&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
            "https://img1.baidu.com/it/u=3229608423,144554567&fm=253&app=120&f=JPEG?w=1351&h=760",
            "https://img0.baidu.com/it/u=3583903682,1590615948&fm=253&app=120&f=JPEG?w=911&h=723",
            "https://img0.baidu.com/it/u=3613907717,1910344794&fm=253&app=120&f=JPEG?w=627&h=909",
            "https://img2.baidu.com/it/u=1158204142,1371130107&fm=253&fmt=auto&app=138&f=JPEG?w=803&h=500",
            "https://img2.baidu.com/it/u=3749862948,713793301&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
            "https://img1.baidu.com/it/u=1803792478,3109323428&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800",
            "https://img1.baidu.com/it/u=3585971855,1527172746&fm=253&fmt=auto&app=138&f=JPEG?w=690&h=437",
            "https://img1.baidu.com/it/u=2667302586,4126117773&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
            "https://img1.baidu.com/it/u=433185194,1699979858&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
            "https://img2.baidu.com/it/u=263512888,374806003&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"]
    },
});